namespace GameCore
{
    public class SimpleGridBackpack : SimpleGridItem
    {
        public Inventory inventory;
        public override void OnClick()
        {
            if (!inventory)
            {
                inventory = PrefabFactory.CreateInstance<Inventory>(resourceID);
                if (itemData.HasData("inventory"))
                {
                    inventory.SetData(itemData.GetData("inventory"));
                }
                else
                {
                    inventory.ResetData();
                    itemData.SetData("inventory", inventory.data);
                    LevelManager.AddInventory(inventory);
                }
            }
            inventory.Show();
        }
    }
}